package com.linxz.framework.base;

import android.os.Bundle;
import android.view.View;

import com.linxz.framework.base.presenter.BasePresenter;


/**
 * @author Linxz
 * 创建日期：2019年02月20日 20:29
 * version：1.0.0
 * 描述：
 */
public abstract class BaseMVPActivity<P extends BasePresenter> extends BaseStatusBarActivity implements View.OnClickListener {


    public P mvpPresenter;
    protected abstract P createPresenter();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        mvpPresenter=createPresenter();
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        hideLoading();
        if (mvpPresenter != null) {
            mvpPresenter.detachView();
        }
    }



    @Override
    public void onClick(View view) {

    }



}
